class Solution:
    def isPowerOfTwo(self, n):
        return n != 0 and (n & (n-1)) == 0

if __name__ == '__main__':
    print Solution().isPowerOfTwo(0)
    print Solution().isPowerOfTwo(2990)
    print Solution().isPowerOfTwo(1024)

